
 	<?php get_header(); ?>
		
		<div class="container-inner clearfix">
		
			<div class="tile-70">
				<div class="category">MOST SHARED</div>
				
				<div class="shared clearfix">
					
					
					<?php if ( have_posts() ) while ( have_posts() ) : the_post();
						$images = get_content_images();

					?>
						
						<div class="<?php echo count( $images ) == 2 ? 'gallery' : 'bigImg'; ?> fleft">
							<div class="autoText">
								<?php
									$categories = get_the_category(); 
									echo strtoupper( $categories[0]->cat_name);
								?>
							</div>
							<a href="<?php the_permalink(); ?>">
								<?php 
								if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
								  the_post_thumbnail('full');
								} 
								?>
								<div class="overlay">
									<div class="title"><?php the_title(); ?></div>
									<div class="desc hide"> <?php the_excerpt(); ?> </div>
									<div class="arrowImage"><i class="icon-share"></i></div>
								</div>
							</a>
						</div>
					<?php
						if( count( $images ) == 2 )
						{
						?>
							<div class="thumb-gallery fleft">
								<?php foreach( $images as $image ) { ?>
								<a href="<?php the_permalink(); ?>">
									<?php echo $image; ?>
								</a> 
								<?php } ?>
							</div>
						<?php
						}
					$i++; endwhile; // end of the loop. ?>		
				</div>
			
				
					<div class="shared clearfix">
						<div class="richfilesProfile">					
							<div class="ImageText">							
									<div class="image"><img src="<?php bloginfo('template_directory'); ?>/images/richfile.jpg"></img></div>
									<div class="Text">PROFILES</div>
									<div class="clear"></div>
							</div>	

						<?php $i=0; query_posts(array('post_type' => 'richfiles', 'posts_per_page' => 9 ));
						if ( have_posts() ) while ( have_posts() ) : the_post(); 

							$post_primary_data = get_post_group_primary( get_the_ID() );
							
							if(  $i < 1 )
							{
								?>
								<div class="ProfileImg">
									<img src="<?php echo $post_primary_data['Gallery']['elements'][0]['image'] ?>"></img>
								</div>
								<div class="ProfileDetails">
									<div class="NameProfession">
										<div class="Worth fright"><?php echo $post_primary_data['Networth(in billion USD)'] ?></div>
										<div class="Name"><?php the_title() ?></div>								
										<div class="Profession"><?php echo $post_primary_data['Business name']; ?></div>															
									</div>							
								</div>
								<div class="Description"><?php the_excerpt() ?></div>
								<?php
							}
							else
							{
							?>
								<div class="hide richfiledetails">
									<div class="ProfileImg">
										<img src="<?php echo $post_primary_data['Gallery']['elements'][0]['image'] ?>"></img>
									</div>
									<div class="ProfileDetails">
										<div class="NameProfession">
											<div class="Worth fright"><?php echo $post_primary_data['Networth(in billion USD)'] ?></div>
											<div class="Name"><?php the_title() ?></div>								
											<div class="Profession"><?php echo $post_primary_data['Business name'] ?></div>															
										</div>							
									</div>
									<div class="Description"><?php the_excerpt() ?></div>
								</div>
								<a href="<?php the_permalink() ?>"><img class="thumbnail" src="<?php echo $post_primary_data['Gallery']['elements'][0]['image'] ?>"></img></a>
							
								<?php
							}
						 $i++; 
						 endwhile;// end of the loop. ?>	


						</div>
					</div>



				
				
				<div class="shared clearfix">
					<div class="contentAd">
						<div class="contentAd1 fleft"><img src="<?php bloginfo('template_directory'); ?>/images/sidebar-ad.jpg"></img></div>
						<div class="contentAd2"><img src="<?php bloginfo('template_directory'); ?>/images/sidebar-ad.jpg"></img></div>
					</div>				
				</div>



			</div> <!-- eof tile70 -->
			
			<?php include('sidebar.php'); ?>
 
		</div> <!-- eof container-inner -->
	
<?php get_footer(); ?>